package com.quickask.entity;

import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.io.Serializable;

/**
 * Created by NaSa on 2015/11/5.
 */

@Entity
@Table(name = "asknow_user_location", schema = "", catalog = "quickask")
public class AsknowUserLocationEntity implements Serializable {

    private Integer userId;
    private Byte type;  //类型
    private Double longitude;   //经度
    private Double latitude;   //纬度
    private Double altitude;   //海拔高度
    private String locationDetail;   //详细位置
    private String provinceCode;  //省编码
    private String cityCode;   //城市编码
    private String blockCode;   //区编码
    private String geohash;  //geohash值

    @Id
    @Column(name = "userId", nullable = true, insertable = true, updatable = true)
    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    @Column(name = "type", nullable = true, insertable = true, updatable = true, scale = 1)
    public Byte getType() {
        return type;
    }

    public void setType(Byte type) {
        this.type = type;
    }

    @Column(name = "longitude", nullable = true, insertable = true, updatable = true, precision = 6)
    public Double getLongitude() {
        return longitude;
    }

    public void setLongitude(Double longitude) {
        this.longitude = longitude;
    }

    @Column(name = "latitude", nullable = true, insertable = true, updatable = true, precision = 6)
    public Double getLatitude() {
        return latitude;
    }

    public void setLatitude(Double latitude) {
        this.latitude = latitude;
    }

    @Column(name = "altitude", nullable = true, insertable = true, updatable = true, precision = 6)
    public Double getAltitude() {
        return altitude;
    }

    public void setAltitude(Double altitude) {
        this.altitude = altitude;
    }

    @Column(name = "locationDetail", nullable = true, insertable = true, updatable = true, length = 100)
    public String getLocationDetail() {
        return locationDetail;
    }

    public void setLocationDetail(String locationDetail) {
        this.locationDetail = locationDetail;
    }

    @Column(name = "geohash", nullable = true, insertable = true, updatable = true, length = 64)
    public String getGeohash() {
        return geohash;
    }

    public void setGeohash(String geohash) {
        this.geohash = geohash;
    }

    @Column(name = "provinceCode", nullable = true, insertable = true, updatable = true, length = 10)
    public String getProvinceCode() {
        return provinceCode;
    }

    public void setProvinceCode(String provinceCode) {
        this.provinceCode = provinceCode;
    }

    @Column(name = "cityCode", nullable = true, insertable = true, updatable = true, length = 10)
    public String getCityCode() {
        return cityCode;
    }

    public void setCityCode(String cityCode) {
        this.cityCode = cityCode;
    }

    @Column(name = "blockCode", nullable = true, insertable = true, updatable = true, length = 10)
    public String getBlockCode() {
        return blockCode;
    }

    public void setBlockCode(String blockCode) {
        this.blockCode = blockCode;
    }

    /**
     * @OneToOne：一对一关联
     * mappedBy = "asknowUserLocationEntity"：意思是说这里的一对一配置参考了card
     * asknowUserLocationEntity又是什么呢?asknowUserLocationEntity是AsknowUserEntity类中的getAsknowUserLocationEntity(),注意不是AsknowUserEntity类中的
     * asknowUserLocationEntity属性,AsknowUserEntity类中的OneToOne配置就是在getAsknowUserLocationEntity()方法上面配的.
     * 如果Person类中的getAsknowUserLocationEntity()方法改成getIdCard(),其他不变的话,
     * 这里就要写成：mappedBy = "idCard"
     */

}
